import { createSlice } from '@reduxjs/toolkit'

const darkSlice = createSlice({
    name: 'dark-slice',
    initialState: {
        darkMode: false
    },
    reducers: {
        toggleDarkMode:(state,action) =>{
            state.darkMode = action.payload
        }
    }
})

export const { toggleDarkMode } = darkSlice.actions;
export default darkSlice.reducer